/**
 * 
 */
package com.wordpress.sharebyblog.world.dao;

import java.io.Serializable;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;



/**
 * @author Bharat Mehta
 *
 */
public class GenericDAOImpl<T extends Serializable> implements GenericDAO<T> {

	@PersistenceContext
	private EntityManager entityManager;

	@Override
	public T findById(Class className, Object id) {
		return (T) entityManager.find(className, id);
	}

	/**
	 * @return the entityManager
	 */
	public EntityManager getEntityManager() {
		return entityManager;
	}

	/**
	 * @param entityManager the entityManager to set
	 */
	public void setEntityManager(EntityManager entityManager) {
		this.entityManager = entityManager;
	}
	
	
	

	
	

}
